﻿@model IEnumerable<b7.Models.Sanpham>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutManager.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
   @* @using (Html.BeginForm("Search","Sanpham"))
    { 
        <p>Genre: @Html.DropDownList("nhomsp", "All")  
        Title: @Html.TextBox("searchstring")  
         <input type="submit" value="Search" /></p>
    }*@
</p>

<table>
    <tr >
        <th>
            Images
        </th>
        <th>
            Name
        </th>
        <th>
            OldPrice
        </th>
        <th>
            SalePrice
        </th>
        <th>
            Quantity
        </th>
        <th>
            NgayBatdau
        </th>
        <th>
            NgayKetThuc
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr style="border:solid 1px #000;">
        <td >
            <img src="../..@Html.DisplayFor(modelItem => item.Anh)" alt="Anh Quang Cao" height="60px" width="60px"/>
        </td>
        <td>
            @*@Html.DisplayFor(modelItem => item.Anh)*@
            
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OldPrice)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SalePrice)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Quantity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NgayBatdau)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NgayKetThuc)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.SanphamId }) |
            @Html.ActionLink("Details", "Details", new { id = item.SanphamId }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.SanphamId })
        </td>
    </tr>
}

</table>
